In data storage systems, often data is stored with redundancy to protect against component failures resulting in loss of data. Such data redundancy can be provided by simple data mirroring or parity-based techniques. Conventional Redundant Array of Inexpensive Disks (RAID) stripe configurations effectively group capacity from all but one of the disk drives in a striped volume and write the parity (XOR) of that capacity on the remaining storage device (or across multiple storage devices). When there is a failure, the data located on the failed storage device is reconstructed using data from the remaining storage devices. The reconstruction process generally takes a series of data reads and data writes from the surviving storage devices.
When data is updated by a data write from a host computer to the storage system, the redundancy data (parity) must also be updated atomically on the striped volume to maintain consistency of data and parity for data reconstruction or recovery as needed. The parity update process is fairly straightforward for full stripe writes in a controller write cache memory. The portion of data in any one stripe of one storage device is called a strip or chunk. Parity is calculated as the XOR of all data chunks in the same stripe. Therefore, if all data chunks for the same stripe are already in the write cache (as would be the case for a full stripe write), all that is needed is to XOR all of the chunks in the same stripe together in order to obtain the parity chunk, and write the data chunks and new parity chunk to the striped volume.
Although full stripe writes are fairly straightforward and can be efficiently destaged from a cache memory in normal operation, partial stripe writes are often more complicated. Partial stripe writes are writes whereby less than all data chunks in a stripe have new (dirty) data. Therefore, the dirty data chunks are stored in the write cache and the unchanged (old) data chunks are stored in the striped volume. Depending on the number of storage devices in the striped array, it will be necessary to read the old chunks from the striped array, XOR the dirty chunks with the old chunks to obtain the new parity chunk, and write the dirty chunks and the new parity chunk to the striped volume. Because of a relatively high number of reads and writes to the striped volume, destaging partial stripe writes needs to be carefully planned in order to not significantly impact performance of the storage system.